package com.hdoit.apollo.web.base.intceptor;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.hdoit.apollo.logical.shop.model.Staff;
import com.hdoit.apollo.logical.shop.service.IStaffService;
import com.tennetcn.authority.common.message.ApiLoginModel;
import com.tennetcn.authority.component.handler.IApiLoginModelIntceptor;

@Component
public class ApiLoginModelIntceptor implements IApiLoginModelIntceptor{
	
	@Autowired
	private IStaffService staffService;
	
	@Override
	public Object execGet(String key, ApiLoginModel apiLoginModel) {
		if("shopId".equals(key)) {
			Staff staff=staffService.queryModel(apiLoginModel.getLoginId());
			return staff.getShopId();
		}
		return null;
	}

}
